<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>log-kotlin-String | 陈科衡的博客</title>

  <!-- keywords -->
  
    <meta name="keywords" content="log">
  

  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="Kotlin - 字符串字符串只是一个字符串序列，包含在双引号中。在 Kotlin 中，字符串由类型 String 表示。它是实践中使用最广泛的数据类型之一。 1. 声明声明字符串变量： 1val str: String &#x3D; &quot;Hello Kotlin&quot; 当然，因为 Kotlin 出色的类型推断，您常常无需表明类型： 1val str &#x3D; &quot;Hello Kotlin&amp;">
<meta property="og:type" content="article">
<meta property="og:title" content="kotlin-String">
<meta property="og:url" content="https://github.com/can-dy-jack/can-dy-jack.github.io/kotlin/kotlin-String/index.html">
<meta property="og:site_name" content="陈科衡的博客">
<meta property="og:description" content="Kotlin - 字符串字符串只是一个字符串序列，包含在双引号中。在 Kotlin 中，字符串由类型 String 表示。它是实践中使用最广泛的数据类型之一。 1. 声明声明字符串变量： 1val str: String &#x3D; &quot;Hello Kotlin&quot; 当然，因为 Kotlin 出色的类型推断，您常常无需表明类型： 1val str &#x3D; &quot;Hello Kotlin&amp;">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-12-11T14:41:05.000Z">
<meta property="article:modified_time" content="2020-12-26T13:28:30.476Z">
<meta property="article:author" content="Kart jim">
<meta property="article:tag" content="kotlin">
<meta property="article:tag" content="andriod">
<meta property="article:tag" content="first">
<meta name="twitter:card" content="summary">
  
    <link rel="alternative" href="/atom.xml" title="陈科衡的博客" type="application/atom+xml">
  
  
    <link rel="icon" href="/img/logo.jpg">
  
  
<link rel="stylesheet" href="/css/style.css">

  
  

  
<script src="//cdn.bootcss.com/require.js/2.3.2/require.min.js"></script>

  
<script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>


  
      <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
<script>AV.initialize("n54fvATe6tx6CJx7XqpWsacb-gzGzoHsz", "3h43n4iW81varlSuI4gBfvIN");</script>

<script src="/js/Counter.js"></script>

  
<meta name="generator" content="Hexo 5.3.0"></head>
<body>
  <div id="container">
    <div id="particles-js"></div>
    <div class="left-col">
    <div class="overlay"></div>
<div class="intrude-less">
	<header id="header" class="inner">
		<a href="/" class="profilepic">
			
			<img lazy-src="/img/202.jpg" class="js-avatar">
			
		</a>

		<hgroup>
		  <h1 class="header-author"><a href="/"></a></h1>
		</hgroup>

		

		
			<div class="switch-btn">
				<div class="icon">
					<div class="icon-ctn">
						<div class="icon-wrap icon-house" data-idx="0">
							<div class="birdhouse"></div>
							<div class="birdhouse_holes"></div>
						</div>
						<div class="icon-wrap icon-ribbon hide" data-idx="1">
							<div class="ribbon"></div>
						</div>
						
						<div class="icon-wrap icon-link hide" data-idx="2">
							<div class="loopback_l"></div>
							<div class="loopback_r"></div>
						</div>
						
						
						<div class="icon-wrap icon-me hide" data-idx="3">
							<div class="user"></div>
							<div class="shoulder"></div>
						</div>
						
					</div>
					
				</div>
				<div class="tips-box hide">
					<div class="tips-arrow"></div>
					<ul class="tips-inner">
						<li>菜单</li>
						<li>标签</li>
						
						<li>友情链接</li>
						
						
						<li>关于我</li>
						
					</ul>
				</div>
			</div>
		

		<div class="switch-area">
			<div class="switch-wrap">
				<section class="switch-part switch-part1">
					<nav class="header-menu">
						<ul>
						
							<li><a href="/">主页</a></li>
				        
							<li><a href="/archives">所有文章</a></li>
				        
							<li><a href="/tags/%E5%89%8D%E7%AB%AF">前端</a></li>
				        
						</ul>
					</nav>
					<nav class="header-nav">
						<div class="social">
							
								<a class="github" target="_blank" href="https://github.com/can-dy-jack" title="github">github</a>
					        
								<a class="zhihu" target="_blank" href="https://www.zhihu.com" title="zhihu">zhihu</a>
					        
						</div>
					</nav>
				</section>
				
				
				<section class="switch-part switch-part2">
					<div class="widget tagcloud" id="js-tagcloud">
						<a href="/tags/TypeScript/" style="font-size: 10px;">TypeScript</a> <a href="/tags/andriod/" style="font-size: 12.5px;">andriod</a> <a href="/tags/css/" style="font-size: 10px;">css</a> <a href="/tags/default/" style="font-size: 10px;">default</a> <a href="/tags/first/" style="font-size: 12.5px;">first</a> <a href="/tags/hexo/" style="font-size: 12.5px;">hexo</a> <a href="/tags/html/" style="font-size: 12.5px;">html</a> <a href="/tags/java/" style="font-size: 10px;">java</a> <a href="/tags/javascript/" style="font-size: 12.5px;">javascript</a> <a href="/tags/kotlin/" style="font-size: 12.5px;">kotlin</a> <a href="/tags/post/" style="font-size: 10px;">post</a> <a href="/tags/simple/" style="font-size: 10px;">simple</a> <a href="/tags/time/" style="font-size: 10px;">time</a> <a href="/tags/%E5%89%8D%E7%AB%AF/" style="font-size: 17.5px;">前端</a> <a href="/tags/%E5%AE%98%E7%BD%91%E5%AD%A6%E4%B9%A0/" style="font-size: 15px;">官网学习</a> <a href="/tags/%E9%9A%8F%E7%AC%94/" style="font-size: 20px;">随笔</a>
					</div>
				</section>
				
				
				
				<section class="switch-part switch-part3">
					<div id="js-friends">
					
			          <a target="_blank" class="main-nav-link switch-friends-link" href="https://github.com/smackgg/hexo-theme-smackdown">smackdown</a>
			        
			          <a target="_blank" class="main-nav-link switch-friends-link" href="http://kartjim.gitee.io/kartpress">kartpress</a>
			        
			          <a target="_blank" class="main-nav-link switch-friends-link" href="http://moriafly.xyz">moriafly`web</a>
			        
			          <a target="_blank" class="main-nav-link switch-friends-link" href="https://github.com/can-dy-jack/jim">jim</a>
			        
			        </div>
				</section>
				

				
				
				<section class="switch-part switch-part4">
				
					<div id="js-aboutme">陈科衡，上海海洋大学在校生。</div>
				</section>
				
			</div>
		</div>
	</header>				
</div>
    </div>
    <div class="mid-col">
      <nav id="mobile-nav">
  	<div class="overlay">
  		<div class="slider-trigger"></div>
  		<h1 class="header-author js-mobile-header hide"></h1>
  	</div>
	<div class="intrude-less">
		<header id="header" class="inner">
			<div class="profilepic">
				<img lazy-src="/img/202.jpg" class="js-avatar">
			</div>
			<hgroup>
			  <h1 class="header-author"></h1>
			</hgroup>
			
			<nav class="header-menu">
				<ul>
				
					<li><a href="/">主页</a></li>
		        
					<li><a href="/archives">所有文章</a></li>
		        
					<li><a href="/tags/%E5%89%8D%E7%AB%AF">前端</a></li>
		        
		        <div class="clearfix"></div>
				</ul>
			</nav>
			<nav class="header-nav">
				<div class="social">
					
						<a class="github" target="_blank" href="https://github.com/can-dy-jack" title="github">github</a>
			        
						<a class="zhihu" target="_blank" href="https://www.zhihu.com" title="zhihu">zhihu</a>
			        
				</div>
			</nav>
		</header>				
	</div>
</nav>
      <div class="body-wrap"><article id="post-kotlin-String" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/kotlin/kotlin-String/" class="article-date">
  	<time datetime="2020-12-11T14:41:05.000Z" itemprop="datePublished">2020-12-11</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      kotlin-String
      
    </h1>
  

      </header>
      
      <div class="article-info article-info-post">
        
	<div class="article-tag tagcloud">
		<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/andriod/" rel="tag">andriod</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/first/" rel="tag">first</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/kotlin/" rel="tag">kotlin</a></li></ul>
	</div>

        
	<div class="article-category tagcloud">
	<a class="article-category-link" href="/categories/kotlin/">kotlin</a>
	</div>


        
          
<div class="counter-tag counter">
    <span id="/kotlin/kotlin-String/" class="leancloud_visitors post-title-link"
          style="font-size: 12px" data-flag-title="kotlin-String">
         &nbsp;
        view
    </span>
</div>

        
        <div class="clearfix"></div>
      </div>
      
    
    <div class="article-entry" itemprop="articleBody">
      
        <h1 id="Kotlin-字符串"><a href="#Kotlin-字符串" class="headerlink" title="Kotlin - 字符串"></a>Kotlin - 字符串</h1><p>字符串只是一个字符串序列，包含在双引号中。在 Kotlin 中，字符串由类型 <code>String</code> 表示。它是实践中使用最广泛的数据类型之一。</p>
<h4 id="1-声明"><a href="#1-声明" class="headerlink" title="1. 声明"></a>1. 声明</h4><p>声明字符串变量：</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">val</span> str: String = <span class="string">&quot;Hello Kotlin&quot;</span></span><br></pre></td></tr></table></figure>
<p>当然，因为 Kotlin 出色的类型推断，您常常无需表明类型：</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">val</span> str = <span class="string">&quot;Hello Kotlin&quot;</span></span><br></pre></td></tr></table></figure>
<h4 id="2-字符串的长度"><a href="#2-字符串的长度" class="headerlink" title="2. 字符串的长度"></a>2. 字符串的长度</h4><p>您可以获取访问属性的字符串中的字符数。此属性具有类型的值。<code>length</code> <code>Int</code></p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">val</span> language = <span class="string">&quot;Kotlin&quot;</span></span><br><span class="line">println(language.length) <span class="comment">// 6</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">val</span> empty = <span class="string">&quot;&quot;</span></span><br><span class="line">println(empty.length) <span class="comment">// 0</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 关于汉字的长度</span></span><br><span class="line"><span class="keyword">val</span> str = <span class="string">&quot;你好&quot;</span></span><br><span class="line">println(str.length) <span class="comment">// 2</span></span><br></pre></td></tr></table></figure>
<h4 id="3-访问字符"><a href="#3-访问字符" class="headerlink" title="3. 访问字符"></a>3. 访问字符</h4><p>字符串的元素是单个字符，可以通过其索引访问。字符串的第一个元素具有索引 0 。</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">val</span> greeting = <span class="string">&quot;Hello&quot;</span></span><br><span class="line"> </span><br><span class="line"><span class="keyword">val</span> first = greeting[<span class="number">0</span>]  <span class="comment">// &#x27;H&#x27;</span></span><br><span class="line"><span class="keyword">val</span> second = greeting[<span class="number">1</span>] <span class="comment">// &#x27;e&#x27;</span></span><br><span class="line"><span class="keyword">val</span> five = greeting[<span class="number">4</span>]   <span class="comment">// &#x27;o&#x27;</span></span><br></pre></td></tr></table></figure>
<p>最后一个元素的索引等于字符串的长度减去 1 。对于字符串，最后一个元素为 。其索引为 4 ，因为字符串的长度为  5 。</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">val</span> last = greeting[greeting.length - <span class="number">1</span>] <span class="comment">// &#x27;o&#x27;</span></span><br><span class="line"><span class="keyword">val</span> prelast = greeting[greeting.length - <span class="number">2</span>] <span class="comment">// &#x27;l&#x27;</span></span><br></pre></td></tr></table></figure>
<p>Kotlin 提供了几种访问字符串的第一个字符和最后一个字符的便捷方法：</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">println(greeting.first())   <span class="comment">// &#x27;H&#x27;</span></span><br><span class="line">println(greeting.last())    <span class="comment">// &#x27;o&#x27;</span></span><br><span class="line">println(greeting.lastIndex) <span class="comment">// 4</span></span><br></pre></td></tr></table></figure>
<p>您可以使用此功能编写更具可读性的代码。<br>还可以用 for 循环迭代字符串:</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">for</span> (c <span class="keyword">in</span> str) &#123;</span><br><span class="line">    println(c)</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h4 id="4-不变性"><a href="#4-不变性" class="headerlink" title="4. 不变性"></a>4. 不变性</h4><p>字符串是不可变的，意思是，一旦创建字符串总是相同的。不能修改字符串的元素。因此，下面的示例不起作用：</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">val</span> str = <span class="string">&quot;string&quot;</span></span><br><span class="line">str[<span class="number">3</span>] = <span class="string">&#x27;o&#x27;</span> <span class="comment">// an error here!</span></span><br></pre></td></tr></table></figure>
<p>但这个工作：</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> str = <span class="string">&quot;string&quot;</span></span><br><span class="line">str = <span class="string">&quot;strong&quot;</span></span><br></pre></td></tr></table></figure>
<p>实际上，我们不会修改变量中的存储值。相反，我们为它分配一个新值。因此，这是绝对合法的。这是使用字符串的方法之一。如果需要修改字符串，只需创建一个新字符串。</p>
<h4 id="5-连接字符串"><a href="#5-连接字符串" class="headerlink" title="5. 连接字符串"></a>5. 连接字符串</h4><p>可以使用运算符连接两个字符串：</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">val</span> str1 = <span class="string">&quot;ab&quot;</span></span><br><span class="line"><span class="keyword">val</span> str2 = <span class="string">&quot;cde&quot;</span></span><br><span class="line"><span class="keyword">val</span> result = str1 + str2 <span class="comment">// &quot;abcde&quot;</span></span><br></pre></td></tr></table></figure>
<p>当我们连接两个字符串时，将创建一个新字符串（因为字符串是不可变的）。</p>
<p>可以在同一表达式中串联多个字符串：</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">val</span> firstName = <span class="string">&quot;John&quot;</span></span><br><span class="line"><span class="keyword">val</span> lastName = <span class="string">&quot;Smith&quot;</span></span><br><span class="line"><span class="keyword">val</span> fullName = firstName + <span class="string">&quot; &quot;</span> + lastName</span><br></pre></td></tr></table></figure>
<p>注意，不一样，因为串联不是换向操作（不像添加）。<br>将值追加到字符串<br>该运算符还适用于将不同类型的值附加到字符串。该值将自动转换为字符串，然后串联到目标字符串。</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">val</span> str = <span class="string">&quot;abc&quot;</span> + <span class="number">10</span> + <span class="literal">true</span></span><br><span class="line">println(str) <span class="comment">// abc10true</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">val</span> code = <span class="string">&quot;123&quot;</span> + <span class="number">456</span> + <span class="string">&quot;789&quot;</span></span><br><span class="line">println(code) <span class="comment">// 123456789</span></span><br></pre></td></tr></table></figure>
<p>表达式必须始终以字符串为起点，请看下面的示例。它不工作，因为第一个操作数是一个数字：</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">val</span> str = <span class="number">10</span> + <span class="string">&quot;abc&quot;</span> <span class="comment">// an error here!</span></span><br></pre></td></tr></table></figure>
<p>下一个可能会令您大吃一惊：</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">val</span> str = <span class="string">&quot;abc&quot;</span> + <span class="number">11</span> + <span class="number">22</span></span><br><span class="line">println(str) <span class="comment">// abc1122</span></span><br></pre></td></tr></table></figure>
<p>为什么会这样？因为首先它追加到字符串，然后追加到字符串。</p>
<h4 id="6-比较字符串"><a href="#6-比较字符串" class="headerlink" title="6. 比较字符串"></a>6. 比较字符串</h4><p>要比较两个字符串，请使用（相等）和（不等于）运算符。两个运算符都使用两个字符串作为操作数，并返回类型 （或 ） 的值。</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">val</span> first = <span class="string">&quot;first&quot;</span></span><br><span class="line"><span class="keyword">val</span> second = <span class="string">&quot;second&quot;</span></span><br><span class="line"><span class="keyword">var</span> str = <span class="string">&quot;first&quot;</span></span><br><span class="line"> </span><br><span class="line">println(first == str)  <span class="comment">// true</span></span><br><span class="line">println(first == second) <span class="comment">// false</span></span><br><span class="line">println(first != second) <span class="comment">// true</span></span><br></pre></td></tr></table></figure>
<h4 id="7-字符串模板"><a href="#7-字符串模板" class="headerlink" title="7. 字符串模板"></a>7. 字符串模板</h4><p>字符串字面值可以包含模板表达式 ，即一些小段代码，会求值并把结果合并到字符串中。 模板表达式以美元符（$）开头，由一个简单的名字构成:</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">val</span> i = <span class="number">10</span></span><br><span class="line">println(<span class="string">&quot;i = <span class="variable">$i</span>&quot;</span>) <span class="comment">// 输出“i = 10”</span></span><br></pre></td></tr></table></figure>
<p>或者用花括号括起来的任意表达式:</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">val</span> s = <span class="string">&quot;abc&quot;</span></span><br><span class="line">println(<span class="string">&quot;<span class="variable">$s</span>.length is <span class="subst">$&#123;s.length&#125;</span>&quot;</span>) <span class="comment">// 输出“abc.length is 3”</span></span><br></pre></td></tr></table></figure>
<p>原始字符串与转义字符串内部都支持模板。 如果你需要在原始字符串中表示字面值 $ 字符（它不支持反斜杠转义），你可以用下列语法：</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">val</span> price = <span class="string">&quot;&quot;&quot;</span></span><br><span class="line"><span class="string"><span class="subst">$&#123;<span class="string">&#x27;$&#x27;</span>&#125;</span>9.99</span></span><br><span class="line"><span class="string">&quot;&quot;&quot;</span></span><br></pre></td></tr></table></figure>
<h4 id="8-其他"><a href="#8-其他" class="headerlink" title="8. 其他"></a>8. 其他</h4><p>原始字符串 使用三个引号（”””）分界符括起来，内部没有转义并且可以包含换行以及任何其他字符:</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">val</span> text = <span class="string">&quot;&quot;&quot;</span></span><br><span class="line"><span class="string">    for (c in &quot;foo&quot;)</span></span><br><span class="line"><span class="string">        print(c)</span></span><br><span class="line"><span class="string">&quot;&quot;&quot;</span></span><br></pre></td></tr></table></figure>
<p>你可以通过 <code>trimMargin()</code> 函数去除前导空格：</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">val</span> text = <span class="string">&quot;&quot;&quot;</span></span><br><span class="line"><span class="string">    |Tell me and I forget.</span></span><br><span class="line"><span class="string">    |Teach me and I remember.</span></span><br><span class="line"><span class="string">    |Involve me and I learn.</span></span><br><span class="line"><span class="string">    |(Benjamin Franklin)</span></span><br><span class="line"><span class="string">    &quot;&quot;&quot;</span>.trimMargin()</span><br></pre></td></tr></table></figure>
<p>默认 <code>|</code> 用作边界前缀，但你可以选择其他字符并作为参数传入，比如 <code>trimMargin(&quot;&gt;&quot;)</code> 。<br><a target="_blank" rel="noopener" href="https://blog.csdn.net/moriafly/article/details/107165523">文章出处</a></p>
<p>*[文章出处]:moriafly</p>

      
    </div>
    
  </div>
  
    
<nav id="article-nav">
  
    <a href="/%E9%9A%8F%E7%AC%94/%E5%9F%BA%E6%9C%AC%E5%B8%B8%E8%AF%86/%E5%B8%B8%E8%A7%81%E7%9A%84%E5%9B%BE%E7%89%87%E6%A0%BC%E5%BC%8F/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">&lt;</strong>
      <div class="article-nav-title">
        
          常见的图像文件格式
        
      </div>
    </a>
  
  
    <a href="/%E9%9A%8F%E7%AC%94/%E7%BB%88%E7%AB%AF%E6%9C%BA%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/" id="article-nav-older" class="article-nav-link-wrap">
      <div class="article-nav-title">终端机常用命令</div>
      <strong class="article-nav-caption">&gt;</strong>
    </a>
  
</nav>

  
</article>


<div class="ds-share share" data-thread-key="kotlin-String" data-title="kotlin-String" data-url="https://github.com/can-dy-jack/can-dy-jack.github.io/kotlin/kotlin-String/"  data-images="/img/202.jpg" data-content="kotlin-String">
    <div class="ds-share-inline">
      <ul  class="ds-share-icons-16">
      	<li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
        <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
        <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
        <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
        <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>
      </ul>
      <div class="ds-share-icons-more">
      </div>
    </div>
 </div>
 





</div>
      <footer id="footer">
  <div class="outer">
    <div id="footer-info">
      <div class="footer-left">
        &copy; 2020 Kart jim
      </div>
        <div class="footer-right">
          <a href="http://hexo.io/" target="_blank">Hexo</a>  Theme <a href="https://github.com/smackgg/hexo-theme-smackdown" target="_blank">Smackdown</a>
        </div>
    </div>
  </div>
</footer>
    </div>
    
  
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css">



<script>
	var yiliaConfig = {
		fancybox: true,
		mathjax: true,
		animate: true,
		isHome: false,
		isPost: true,
		isArchive: false,
		isTag: false,
		isCategory: false,
		open_in_new: false
	}
</script>

<script src="/js/main.js"></script>




<script type="text/x-mathjax-config">
MathJax.Hub.Config({
    tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
        processEscapes: true,
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    }
});

MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
        all[i].SourceElement().parentNode.className += ' has-jax';                 
    }       
});
</script>

<script src="//cdn.bootcss.com/mathjax/2.7.0/MathJax.js"></script>


  </div>
</body>
</html>